package com.jn.retrofit.contract;

import com.jn.retrofit.entity.Dictionary;
import com.jn.retrofit.entity.HotSearch;
import com.jn.retrofit.entity.TranslateRequest;
import com.jn.retrofit.entity.TranslateResponse;

import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface ApiService {
    @Headers({
            "Accept: application/json",
            "Content-Type: application/json"
    })
    @GET("api/common/fetchHotSearchBoard")
    Call<HotSearch> getHotSearch(@Query("type") String type);

    @Headers({
            "Accept: application/json",
            "Content-Type: application/json"
    })
    @GET("api/txt/dict")
    Call<Dictionary> getDict();

    @Headers({
            "Accept: application/json",
            "Content-Type: application/json"
    })
    @POST("api/txt/QQFanyi")
    Call<TranslateResponse> postTranslation(@Body TranslateRequest request);
}
